#ifndef LEARNERMODEL_H
#define LEARNERMODEL_H


#include <QList>
#include <QString>
#include <QObject>
#include "itsaction.h"
#include "mission.h"
#include "../knowledgebase.h"

namespace IAlib
{

class IA_LIBSHARED_EXPORT LearnerModel: public QObject
{

    Q_OBJECT

public:

    LearnerModel();
    LearnerModel(const LearnerModel& model);
    ~LearnerModel();

    void setId(const QString& id) { m_id = id; }
    QString getId() const { return m_id; }

    void setRole(const QString& role) { m_role = role; }
    QString getRole() const { return m_role; }

    QList<ItsAction*> getActions() const { return m_its_actions; }
    ItsAction* getAction(const int index);

    QList<QString> getPerformedMissions() const { return m_performed_missions; }

    void addAction(const ItsAction& its_action);
    void removeAction(const int index);

    void addPerformedMission(const QString& mission_name);
    //void removeAssignedMission(const QString& mission_name);

    void getKnowledgesBase() const;
    void addKnowledgeBase(Knowledges * kw);

    QDomElement toXML(QDomDocument &doc);
    void        fromXML(QDomElement ele);

    int hasMission(const QString& mission_name) const;

    LearnerModel& operator=(const LearnerModel& model);

private:

    QString m_id;
    QString m_role;
    QList<QString>     m_performed_missions;
    QList<ItsAction*>  m_its_actions;
    KnowledgeBase      m_knowledges_base;

signals:

    void newAction(const QString actor_id);
    void newKnowledge(const QString actor_id);
};

}

#endif // LEARNERMODEL_H
